﻿<sap:ActivityDesigner x:Class="WFDataBaseProject.Controls.UCProfileActivityDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:helpers="clr-namespace:WFDataBaseProject.Helpers"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"                    
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation">
    <sap:ActivityDesigner.Resources>
        <sapc:ArgumentToExpressionConverter x:Key="argumentToExpressionConverter"/>
        <DataTemplate x:Key="expanded">
            <StackPanel Orientation="Vertical">

                <!--Sql server-->
                <TextBlock Text="Sql server:"/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                    HintText="Enter the connection string"
                                    ExpressionType="{x:Type s:String}"
                                    Expression="{Binding ModelItem.SQLSERVER,Mode=TwoWay,
                Converter={StaticResource argumentToExpressionConverter},
                ConverterParameter=In}"/>
                <!--Hierarchy-->
                <TextBlock Text="Hierarchy(ProfileHierarchy):"/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                    HintText="Enter the hierarchy"
                                    ExpressionType="{x:Type helpers:ProfileHierarchy}"
                                    Expression="{Binding ModelItem.Hierarchy,Mode=TwoWay,
                Converter={StaticResource argumentToExpressionConverter},
                ConverterParameter=In}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="collapsed">
            
        </DataTemplate>
        <!--Style for activity designer-->
        <Style x:Key="displaymodestyle" TargetType="{x:Type ContentPresenter}">
            <Setter Property="ContentTemplate" Value="{DynamicResource expanded}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="false">
                    <Setter Property="ContentTemplate" Value="{DynamicResource collapsed}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </sap:ActivityDesigner.Resources>
    <Grid>
        <ContentPresenter Style="{DynamicResource displaymodestyle}" Content="{Binding}" />
    </Grid> 
</sap:ActivityDesigner>
